import { defineStore } from 'pinia';
import { reqMockdata } from '@/api/home/index';
import type { MockData } from './interface';
// 定义一个小仓库
const UseMockStore = defineStore('MockStore', {
  // 存放数据
  state() {
    return {
        // 存储mock数据
        MackObj:{} as MockData
    };
  },

  // 业务逻辑
  actions: {
    async getMockData() {
      // 发请求获取mock数据
    let res =  await reqMockdata();
    // 替换数据
    this.MackObj = res
    console.log(res)
    },
  },
});

// 暴露
export default UseMockStore;
